package com.CST.mapper.cst;

import com.CST.bo.BaseInfoBO;
import com.CST.dto.DateDTO;
import com.CST.entity.BaseCost;
import com.CST.entity.BdDepartment;
import com.CST.entity.CostDataInfo;
import com.CST.vo.HygienicMaterialsVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2022-01-24
 */
@Repository
public interface CostDataMapper extends BaseMapper<CostDataInfo> {


    //成本数据
    List<CostDataInfo> getCostDataSource(CostDataInfo entity);

    /**
     * 获取成本数据
     */
    List<BaseCost> listBaseCostData(CostDataInfo costDataInfo);

    /**
     * 获取药品费成本数据
     */
    List<CostDataInfo> listCostByPDeptCodeAndUnitCode(@Param("dateDTO") DateDTO dateDTO,
                                                      @Param("pDeptCode") String pDeptCode);

    /**
     * 卫生材料一级明细
     *
     * @param dateDTO   时间
     * @param list      子科室code集合
     * @return
     */
    List<HygienicMaterialsVO> selectCostItem(@Param("dateDTO") DateDTO dateDTO, @Param("list") List<BdDepartment> list);

    /**
     * 卫生材料二级明细
     *
     * @param dateDTO
     * @param pDeptCode
     * @return
     */
    List<BaseInfoBO> listCostByPDeptCodeAndUnitCodeInfo(@Param("dateDTO") DateDTO dateDTO,
                                                        @Param("pDeptCode") String pDeptCode);

    List<CostDataInfo> listCostByDeptCodeAndUnitCode(@Param("dateDTO") DateDTO dateDTO,
                                                     @Param("deptCode") String deptCode);
}
